<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>JS-函数</title>
</head>
<body>
  

  <script>
    

    // 创建自定义对象，设置属性和函数，每个成员之间用逗号分隔
    let user = {
      name: '张三',
      age: 18,
      sex: '男',
      // 创建函数
      sing(){
        alert(this.name +"  " + this.age + "岁"+"唱着最炫民族风");
      }
    }

  
    alert(user.name);
    user.sing();
   
  </script>
</body>
</html>